package com.jt.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProviderController {
    @Value("${server.port:8080}")
    private String server;

    @Value("${useLocalCache:false}")
    private boolean useLocalCache;

    @Value("${app.secret:123456}")
    private String secret;

    @GetMapping("/provider/echo/{msg}")
    public String doRestEcho1(@PathVariable String msg){

        return server+"say hello"+msg;
    }

    @RequestMapping("/provider/cache01")
    public String doUseLocalCache01(){
        return "The value of useLocalCache is "+useLocalCache;
    }

    @GetMapping("/provider/secret")
    public String doGetSecret(){
        return "The secret is "+secret;
    }


}
